
Rob Hecker2
Guru
Rob Hecker2
Guru
Activity
‎Jun 23, 2017
12:14 PM
1 Upvote
You can pass variables to and from the include files in several ways. At this point you should probably start studying basic PHP, but here are some ways to pass variables. If you simply define a variable in the parent page, it will be available in the include. If you define a variable in the include, it will be available in the parent page, but not before the include is called. (example: $myvariable = "apples"; Pass a variable using a URL parameter like this: mypage.php?myvariable=apple. You then retrieve the variable like this: $myvariable = $_GET['myvariable']; Pass a variable in the POST or SESSION array
... View more
‎Jun 23, 2017
10:30 AM
I usually just put the site folder name after the localhost/ so I don't have to do anything. Sure. I think many people do that, but it won't be as close a match to the remote system as if you used virtual hosts. I never use an extension (com net org) when I create virtual hosts, but if I have two sites with the same name but different extensions, I use: china_com china_net
... View more
‎Jun 22, 2017
08:45 AM
1 Upvote
The reason was to mimic the URL structure of the eventual site in order to test the central authentication service on localhost. I recall that from a thread you started some time back. I was skeptical then that your solution was correct. I always create a virtual host that allows my development environment to match the remote environment, for example: http://china -- local development http://china.com -- remote public site And PHP allows you to simply get the host name and use it as a variable, like this: $domain = $_SEVER['HTTP_HOST']; Apache has a lot of capability around domain names and where they can point, so I suggest you dive into the Apache documentation. There are significant differences between Apache 2.2 and 2.4, so make sure you review the documentation for the version you are using.
... View more
‎Jun 20, 2017
11:58 AM
So I can I create the database on Adobe Dreamworks FIRST, then connect to it later? No. You do not create a database in Dreamweaver. There is no connection between DW and the database engine. You use an interface to the database like PHPmyAdmin or MySQL Workbench to create and manage the database. Then, you use PHP within your web pages in Dreamweaver to send SQL scripts to the database and process the results of recordsets from the database.
... View more
‎Jun 20, 2017
08:57 AM
1 Upvote
. . .because localhost is synonymous with this virtual domain. If you really did that, and unless you have an incredibly good reason for having done so, then therein lies your problem. Otherwise it would be possible to create a subdomain on localhost so that: localhost points to the web root (public_html, for example) which may also be the root of the main website example.localhost points to localhost/example . . .so if you really have localhost pointing to something like. . . public_html/newsite . . .then you have created the problem you are now trying to solve
... View more
‎Jun 20, 2017
07:20 AM
1 Upvote
If all the remote scripts are in the same location and therefore have the same initial path, then there would be a way to do this. If you had considered this issue before you built this project, it would have been easier to deal with. You don't tell us if you are using a database, PHP, or what languages. What kinds of scripts are these? Are you using an Apache local server during development? What you want to do is determine what is different between the local environment and the remote environment, and use that to create a conditional. For instance, if the remote environment uses SSL, you might do something in PHP like this: if($_SERVER['SERVER_PORT'] != '443') { // SSL is not used, so it must be the local environment $root_path_to_scripts = "http://localhost/"; } else { $root_path_to_scripts = "https://remotehost/"; } . . .but if the scripts are not in the same path, you would have to write a conditional for each script, which is sloppy and would be timeconsuming if you have many scripts. EDIT: After I posted my response I saw Jon's. That's probably the approach to take.
... View more
‎Jun 20, 2017
12:23 AM
1 Upvote
That is the example code from Apache 2.4. Assuming that you are replacing dummy-host with your domain name and removing the comment characters, that is correct code. The most important lines are the DocumentRoot and ServerName.
... View more
‎Jun 19, 2017
12:00 PM
You need to use one system. If your ecommerce system doesn't use the same database as your brick-and-morter system, then you are not operating in the 21st century and you will have lots of problems as the two systems won't be in sync. It also creates extra work for you or your staff.
... View more
‎Jun 19, 2017
11:41 AM
so prefer to continue working with Dreamweaver if it is capable. As has been explained, DW is a tool, not a format. You can continue to use DW. I can create what you have described. It would involve integrating a database into your website. You will need an interface to manage memberships, etc. as well as the online process for membership purchases. When someone purchases an annual membership, you want the system to check to see if they already have a membership and add 12 months to it. There is more to such a system than you may at first suspect. You can contact me by clicking my name. I would a $100 prepayment for a phone consultation.
... View more
‎Jun 19, 2017
11:13 AM
1 Upvote
I have about 20 virtual hosts pointed to 127.0.0.1 In windows / system32 / drivers / hosts you attach all of them to 127.0.0.1 but in Apache you point each domain to the specific "physical location" in the file path Example: <VirtualHost *:80> DocumentRoot "D:/Apache24/htdocs/yogasite/55" <Directory "D:/Apache24/htdocs/yogasite/55"> Options +Indexes +FollowSymLinks +ExecCGI DirectoryIndex index.php Order allow,deny Allow from all AllowOverride All Require all granted </Directory> ServerName china:80 SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 # include the folder containing the vhost aliases for zend server deployment IncludeOptional "D:\ZendServer\etc\sites.d\http\china\80/*.conf" </VirtualHost>
... View more
‎Jun 19, 2017
11:06 AM
Dreamweaver is a tool, not a format. Basically you are saying something like: My house was built with a Makita saw. I need someone with a Makita saw to build an addition. As Nancy said, When you say eCommerce what exactly do you mean? Are you selling products or services? $100/ day or $100,000/ day? More info needed.
... View more
‎Jun 17, 2017
02:44 PM
. . .and to some degree frameworks PHP frameworks are not like Javascript frameworks or CSS frameworks. They define a way to organize and structure projects. They all include a library of classes. sometimes i wish those days of assembler and C were back Not me. Some I knew who worked with those languages retired handsomely before they were 50, but the work was very hard. but if someone does that why use Wordpress. A few of my clients asked me to turn my application into a wordpress plug-in. I did a lot of research and created a prototype, but no none wanted to foot the cost. Now I have a serious wordpress plug-in competitor that is appealing to my retreat center client base. Wordpress actually has a very good extensible structure.
... View more
‎Jun 17, 2017
01:00 PM
Compare object oriented programming to extensions. OO frameworks and libraries provide complex solutions to common programming tasks that give the coder vast control, opposed to the limitations of extensions. You still have to know how to code, of course. For example, I use Swiftmailer (a class in Symfony) for all emails sent from PHP. It gives me the power of SMTP, HTML email and email attachments without my having to understand the underlying code, yet I can use my PHP knowledge to control and extend what the library does. And most OO libraries play very nicely with whatever your own coding style and application structure is. I did not code in the 70's, but some of my friends coded languages like assembly, fortran and C. I had one friend whose whole career was spent coding assembly. Paula, I know you know what I'm saying, but for those who don't, coding those languages is not fun, it's not fast. It's agonizing and there are no nice wizards, extensions, libraries or anything else to make the job less horrendous. You can't quickly get a visual check of your work but have to work for hours or days before you can even test, and then finding bugs can be very difficult because the system doesn't provide nice error messages or even highlight the line where the problem is. So now it is cushy, fun and fast to code PHP, Java, or C#. Paula, I see the various frameworks and libraries as providing the "replacement parts," not extensions. For instance, if I decided to use ZendMail instead of Swiftmailer, I think I could make the switch in a day.
... View more
‎Jun 16, 2017
03:08 PM
What i cannot see is why, if the method Ben uses of using extensions works for him, and the design looks good, and functions correctly, it would be wrong for him to use extensions, providing the code they produce works fault free and matches the required standards My only argument was that using extensions limits what can be done. A project can't grow and become more sophisticated. The example project Ben provided is a good example. It is a fine for what it is, but it uses only the most rudimentary SQL. There is so much more that can be done with SQL. Oh, I did have a second point, which was that I believe I can type raw PHP and SQL faster than someone can do the same with an extension. Ben claims that using extensions saves him time, but that's just because he isn't fluent in coding.
... View more
‎Jun 16, 2017
10:49 AM
1 Upvote
I'm a self trained brain surgeon, but for some reason i have not found anyone that will employ me or had any patients. Don't worry, sir; I googled vasectomy last night and learned all about the procedure. Nurse, please run that Youtube video again.
... View more
‎Jun 16, 2017
10:17 AM
I would be interested in knowing exactly how someone is defined as being a web developer, In that Sitepoint survey 30% described themselves as full stack developers. I raised my eyebrow at that. It's always interesting with professions that have no required license, as there is (thank god) with the medical and legal professions.
... View more
‎Jun 16, 2017
09:07 AM
Thank you for the example, Ben. That is pretty slick. It is, however, what I would expect one could do with the DB extensions. The query I provided generates an aging detail. (For those who don't know, an aging detail is a financial report that shows what customers have payments in arrears, how much they owe and how late they are. It's a query no DB extension could come up with. I am sure that the DB extensions could handle 90% of the queries I use, but I can also write those queries lickety-split. The problem is when you need something the extension can't handle. For most extension users, that becomes an insurmountable obstacle. Ben, you just can't argue with the fact that an application based on extensions is always going to be confined to the limits of the extension, and the coder who uses them is never going to develop a high level of coding skill. Personally, I really like working through difficult coding problems that make my brain sweat. That can't happen for someone who is writing code by making selections on menus and in forms. Your example reminds of a crazy Fortran coder I knew who had three 1939 Mercedes Limousines, what the Nazi brass drove around in. Profoundly impractical machines.
... View more
‎Jun 16, 2017
07:27 AM
Firstly, anyone who wants to use extensions, fine. Go ahead. You have my blessing. Secondly, I have never tried any of the Dreamweaver extensions. Lastly, I probably should not wander into this 982nd version a long worn out debate. . .but here goes. If you plan to go to Vietnam, you can spend a month learning a little basic Vietnamese, or you can buy a little paperback book of Vietnamese phrases and read it on the flight over. But the person with the phrase book is just making sounds out of their mouth without any understanding of the syntax or vocabulary. The person who learns a little bit of the language can actually have a conversation while the person with the phrase book is hunting through the book to find the translation for "where is the toilet?" People come to this forum all the time in a state of crisis because they have no ability to make the slightest change to the code the extension creates. It might as well be Vietnamese. Ben, you have argued that using extensions speeds up your work, but I can assure you that I can write PHP/SQL code faster than you can work through an extension to achieve the same result. I took a look at the Youtube video you linked to for checking to see if a record already exists in a database. All that requires is a query like "SELECT email FROM users WHERE email=:email." Then you write an if clause to handle the result. If you want to use extensions, fine, but you will never be able to do this. . . $query ="SELECT X.invoice_set, debit_amount, credit_amount, X.invoice_date, X.payment_type, B.date1 AS accom_date, C.product_name AS course_title, first_name, last_name, spiritual_name, email, phone, address_1, address_2, city, state, country, zip FROM( SELECT invoice_set, DATE_FORMAT(CONVERT_TZ(invoice_datetime,'UTC','$timezone'),'%Y-%m-%d') AS invoice_date, student_id, payment_type, SUM(CASE WHEN credit_debit = 'debit' THEN amount END) AS debit_amount, SUM(CASE WHEN credit_debit = 'credit' THEN amount END) AS credit_amount FROM invoice WHERE client_id='".CLIENT_ID."' AND commit_invoice='1' GROUP BY invoice_set )X JOIN invoice AS B ON X.invoice_set = B.invoice_set AND B.product_type='LODGING' AND $rangeset LEFT JOIN invoice AS C ON X.invoice_set = C.invoice_set AND C.product_type='COURSE' JOIN students on X.student_id = students.student_id AND COALESCE(debit_amount,0) > COALESCE(credit_amount,0) GROUP BY X.invoice_set ORDER BY last_name, first_name";
... View more
‎Jun 15, 2017
10:23 AM
Has it ever dawned on you that only paupers who have plenty of time on their hands, would enter a survey, let alone read it. The better calibre of developers spend their time developing and learning. I found the survey interesting and worth seeing. 62% say they use flexbox but 46% say their primary unit of measure is pixels.That seems like a disconnect. No wonder Bootstrap and Dreamweaver don't get a mention. Bootstrap was the highest ranking CSS framework in the survey, at 38%. Dreamweaver, however, claimed just 5% of the IDE share. Eclipse, which I use (Zend Studio) ranked just 1%. Anyway, I thought some of the questions were interesting as questions.
... View more
‎Jun 09, 2017
12:22 PM
You have a real estate question, NOT a dreamweaver question. It's a web design question. It seems to me like a fair question to ask in this forum. My guess is that there are a lot of polished CMS options out there made specifically for the real estate market, so the competition is going to be tough.
... View more
‎Jun 07, 2017
06:13 AM
1 Upvote
SVG is an XML format, not HTML. The tags used to style SVG are not HTML CSS. The WC3 CSS validator will also mark some SVG style elements as errors.
... View more
‎Jun 05, 2017
07:51 AM
1 Upvote
My understanding is that user input and third-party CMS software causes the bulk of security issues. That is correct. You don't need to do anything. You don't even need SSL. Can your site still be hacked? Yes, via FTP. Someone could change the content of your website. The best protection against this is to use a dedicated server or VPS. Shared hosting accounts are notoriously vulnerable to such attacks.
... View more
‎May 30, 2017
05:10 PM
center an element horizontally. vertically. (Can almost never edit a post after submitting it. Very annoying.)
... View more
‎May 30, 2017
05:06 PM
1 Upvote
When I test the form it returns to my home page, but does not receive at [email removed by moderator to save you from spam.] in my gmail account. The script does not send an email. It writes to a file. It's a very amateurish script.
... View more
‎May 30, 2017
04:54 PM
it's 0px and auto ? Zero doesn't require a specific measurement because zero is the same in px, em, rem, and vw. left and right margins of auto will center an element horizontally.
... View more
‎May 30, 2017
01:37 PM
1 Upvote
The basic concept can be found in this tutorial: http://htmldog.com/techniques/dropdowns/ The menu in this tutorial does not address mobile menus.
... View more
‎May 29, 2017
01:32 PM
Ctrl-shift-f will present a window with more options. Click the funnel with the green check to see the option for search text only.
... View more
‎May 29, 2017
07:51 AM
1 Upvote
To start with just a simple contact form that is secure. Do you want the contact form to email or post to a database? Here is a script that emails the response. Take everything that follows and paste it into a blank file. Follow the given instructions. This script must be run on a remote server that contains a mail server. It will not run on your local computer. <?php // Name this file contact.php // Be sure to change the value of $to to your own email address // Be sure to name the file contact.php // the next line only runs the processing script if the form has been submitted. // the next line makes sure the email address is actually an email address // The "!" at the beginning means do the following if the email address is NOT true. Remove the "!" and it would mean IF IS TRUE if (!filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)){ $message="Please provide a correct email address";} else { // strip_tags is a PHP function that removes all tags from a block of text. For instance harmful script could be injected in the form fields by a hacker. strip_tags will remove such scripts. $name = strip_tags($_POST['name']); $company_name = strip_tags($_POST['company_name']); $telephone = strip_tags($_POST['telephone']); $email = $_POST['email']; $comments = strip_tags($_POST['comments']); $to = 'your@emailaddress.com'; $subject = 'Contact form submitted.'; $body = $name. "\n" .$comments; $headers = 'From: ' .$email; // This is the line that actually mails the form data. The PHP function is simply mail(). The function needs to know: // who to send to // what the subject line should be // what the email should consist of // headers can include various info, but in this case just includes the email address of the sender // Note that if the email does not send, a message is returned to notify the user of the failure. if (mail($to, $subject, $body, $headers)) { echo 'Thanks for contacting us. We\'ll be in touch soon!'; } else { $message = 'Sorry an error occurred. Please try again later.'; } } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php echo "<p style='color:red'>$message</p>"; ?> <div class="contact_form"> <form id="contactform" action="contact.php" method="post"> <p>Name:<br/><input name="name" type="text" required /></p> <p>Company Name: <br/><input name="company_name" type="text" required/></p> <p>Telephone: <br/><input name="telephone" type="tel" required/></p> <p>Email: <br/><input name="email" type="email" required/></p> <p>Comments: <br/><textarea name="comments" required/> </textarea></p> <input type="submit" name="submit" value="Send!"/> </form> </div> </body> </html>
... View more
‎May 28, 2017
11:15 AM
You need to tell us more. What kind of form? What does it do? Does it update a database or send an email?
... View more
‎May 28, 2017
10:14 AM
1 Upvote
I took a look at your website and if I were looking for an architectural firm, I would quickly reject yours for consideration. Your firm may actually do great work, but the photographs on your website are completely uninspiring. My suggestions: Hire a great architectural photographer and fill your webiste with large beautiful photographs that showcase your abilities. Tell stories about the challenges that were solved by the designs. Have your website re-designed by someone who lives in 2017, not 2005. Your website really looks dated. Also, you may want to have someone recreate your website in WordPress. You could have a nice modern design and update the content yourself. I don't see a way in which a static site built with Dreamweaver would be superior to that. On your current website, the home page shows no architectural work; just logos. So I click on West Coast. Still no architectural work, just a photo of the pacific north west (lovely, but not relevant). Then I click on projects and the first item is a private residence in Cape Cod? Did I not click on West Coast? Hello? So serious work needs to be done on your website, not just updates.
... View more